package club.haomoon.core.mapper.system;

import club.haomoon.core.common.BaseDataMpper;
import club.haomoon.core.entity.system.SystemMenuData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * -------------------------
 * @Description: 系统菜单Mapper
 * @Author: Wangjianwei
 * @Date: 2025/02/12 15:26
 * -------------------------
 */
@Mapper
public interface SystemMenuDataMapper extends BaseDataMpper<SystemMenuData> {

    @Select({"<script>",
            " SELECT ",
            " perms ",
            " FROM cms_system_menu_data WHERE perms != '' AND id in ",
            "<foreach item='item' index='index' collection='items' open='(' separator=',' close=')'>",
            "#{item}",
            "</foreach>",
            "</script>"})
    List<String> getPerms(@Param("items") List<Integer> menuIds);

}
